package com.p2p.controller.contentManagement;


import com.p2p.common.R;
import com.p2p.entity.Protocol;
import io.swagger.annotations.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/protocol")
@Api(value = "协议配置管理",tags = "协议配置管理接口API")
public class ProtocolController {

    @RequestMapping(value = "/findAllProtocol",method = RequestMethod.GET)
    @ApiOperation(value = "协议配置管理",notes = "显示协议配置管理",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage",value = "当前页码数默认第一页",paramType = "query",dataType = "String",required = true),
            @ApiImplicitParam(name = "pageSize",value = "每页显示记录数",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R findAllProtocol(Integer currentPage,Integer pageSize){
        return null;
    }

    @RequestMapping(value = "/findProtocolById",method = RequestMethod.GET)
    @ApiOperation(value = "返回该协议配置",notes = "返回该协议配置",httpMethod = "GET", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "协议配置id",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R findProtocolById(Integer id){
        return null;
    }

    @RequestMapping(value = "/addProtocol",method = RequestMethod.POST)
    @ApiOperation(value = "添加协议配置",notes = "添加协议配置",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R addProtocol(@RequestBody @ApiParam(name = "protocol",value = "协议实体",required = true)Protocol protocol){
        return null;
    }

    @RequestMapping(value = "/deleteProtocolById",method = RequestMethod.POST)
    @ApiOperation(value = "删除一条协议配置",notes = "删除一条协议配置",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "协议配置id",paramType = "query",dataType = "String",required = true)
    })
    @ResponseBody
    public R deleteProtocolById(Integer id){
        return null;
    }

    @RequestMapping(value = "/updateProtocol",method = RequestMethod.POST)
    @ApiOperation(value = "修改协议配置",notes = "修改协议配置",httpMethod = "POST", response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="登录成功"),
            @ApiResponse(code=400,message="代表参数格式不对"),
            @ApiResponse(code=404,message="代表找不到此请求"),
            @ApiResponse(code=500,message="代表后端代码出现异常"),
    })
    @ResponseBody
    public R updateProtocol(@RequestBody @ApiParam(name = "protocol",value = "协议实体",required = true)Protocol protocol){
        return null;
    }
}
